3.1139 \(\int \sqrt{a+i a \tan (e+f x)} \sqrt{c+d \tan (e+f x)} \, dx\)

Optimal. Leaf size=151 \[ -\frac{2 \sqrt [4]{-1} \sqrt{a} \sqrt{d} \tanh ^{-1}\left (\frac{(-1)^{3/4} \sqrt{d} \sqrt{a+i a \tan (e+f x)}}{\sqrt{a} \sqrt{c+d \tan (e+f x)}}\right )}{f}-\frac{i \sqrt{2} \sqrt{a} \sqrt{c-i d} \tanh ^{-1}\left (\frac{\sqrt{2} \sqrt{a} \sqrt{c+d \tan (e+f x)}}{\sqrt{c-i d} \sqrt{a+i a \tan (e+f x)}}\right )}{f} \]

[Out]

(-2*(-1)^(1/4)*Sqrt[a]*Sqrt[d]*ArcTanh[((-1)^(3/4)*Sqrt[d]*Sqrt[a + I*a*Tan[e + f*x]])/(Sqrt[a]*Sqrt[c + d*Tan
[e + f*x]])])/f - (I*Sqrt[2]*Sqrt[a]*Sqrt[c - I*d]*ArcTanh[(Sqrt[2]*Sqrt[a]*Sqrt[c + d*Tan[e + f*x]])/(Sqrt[c
- I*d]*Sqrt[a + I*a*Tan[e + f*x]])])/f

________________________________________________________________________________________

Rubi [A]  time = 0.417396, antiderivative size = 151, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 7, integrand size = 32, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.219, Rules used = {3563, 3544, 208, 3599, 63, 217, 206} \[ -\frac{2 \sqrt [4]{-1} \sqrt{a} \sqrt{d} \tanh ^{-1}\left (\frac{(-1)^{3/4} \sqrt{d} \sqrt{a+i a \tan (e+f x)}}{\sqrt{a} \sqrt{c+d \tan (e+f x)}}\right )}{f}-\frac{i \sqrt{2} \sqrt{a} \sqrt{c-i d} \tanh ^{-1}\left (\frac{\sqrt{2} \sqrt{a} \sqrt{c+d \tan (e+f x)}}{\sqrt{c-i d} \sqrt{a+i a \tan (e+f x)}}\right )}{f} \]

Antiderivative was successfully verified.

[In]

Int[Sqrt[a + I*a*Tan[e + f*x]]*Sqrt[c + d*Tan[e + f*x]],x]

[Out]

(-2*(-1)^(1/4)*Sqrt[a]*Sqrt[d]*ArcTanh[((-1)^(3/4)*Sqrt[d]*Sqrt[a + I*a*Tan[e + f*x]])/(Sqrt[a]*Sqrt[c + d*Tan
[e + f*x]])])/f - (I*Sqrt[2]*Sqrt[a]*Sqrt[c - I*d]*ArcTanh[(Sqrt[2]*Sqrt[a]*Sqrt[c + d*Tan[e + f*x]])/(Sqrt[c
- I*d]*Sqrt[a + I*a*Tan[e + f*x]])])/f

Rule 3563

Int[Sqrt[(a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]]*Sqrt[(c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]], x_Symbol] :> Dist[
(a*c - b*d)/a, Int[Sqrt[a + b*Tan[e + f*x]]/Sqrt[c + d*Tan[e + f*x]], x], x] + Dist[d/a, Int[(Sqrt[a + b*Tan[e
 + f*x]]*(b + a*Tan[e + f*x]))/Sqrt[c + d*Tan[e + f*x]], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a
*d, 0] && EqQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0]

Rule 3544

Int[Sqrt[(a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]]/Sqrt[(c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]], x_Symbol] :> Dist[
(-2*a*b)/f, Subst[Int[1/(a*c - b*d - 2*a^2*x^2), x], x, Sqrt[c + d*Tan[e + f*x]]/Sqrt[a + b*Tan[e + f*x]]], x]
 /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0]

Rule 208

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-(a/b), 2]*ArcTanh[x/Rt[-(a/b), 2]])/a, x] /; FreeQ[{a,
b}, x] && NegQ[a/b]

Rule 3599

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[(b*B)/f, Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^n, x], x, Tan[e + f*x
]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && EqQ[A*b + a*B,
 0]

Rule 63

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - (a*d)/b + (d*x^p)/b)^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 217

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rubi steps

\begin{align*} \int \sqrt{a+i a \tan (e+f x)} \sqrt{c+d \tan (e+f x)} \, dx &=(c-i d) \int \frac{\sqrt{a+i a \tan (e+f x)}}{\sqrt{c+d \tan (e+f x)}} \, dx+\frac{d \int \frac{\sqrt{a+i a \tan (e+f x)} (i a+a \tan (e+f x))}{\sqrt{c+d \tan (e+f x)}} \, dx}{a}\\ &=\frac{(i a d) \operatorname{Subst}\left (\int \frac{1}{\sqrt{a+i a x} \sqrt{c+d x}} \, dx,x,\tan (e+f x)\right )}{f}-\frac{\left (2 a^2 (i c+d)\right ) \operatorname{Subst}\left (\int \frac{1}{a c-i a d-2 a^2 x^2} \, dx,x,\frac{\sqrt{c+d \tan (e+f x)}}{\sqrt{a+i a \tan (e+f x)}}\right )}{f}\\ &=-\frac{i \sqrt{2} \sqrt{a} \sqrt{c-i d} \tanh ^{-1}\left (\frac{\sqrt{2} \sqrt{a} \sqrt{c+d \tan (e+f x)}}{\sqrt{c-i d} \sqrt{a+i a \tan (e+f x)}}\right )}{f}+\frac{(2 d) \operatorname{Subst}\left (\int \frac{1}{\sqrt{c+i d-\frac{i d x^2}{a}}} \, dx,x,\sqrt{a+i a \tan (e+f x)}\right )}{f}\\ &=-\frac{i \sqrt{2} \sqrt{a} \sqrt{c-i d} \tanh ^{-1}\left (\frac{\sqrt{2} \sqrt{a} \sqrt{c+d \tan (e+f x)}}{\sqrt{c-i d} \sqrt{a+i a \tan (e+f x)}}\right )}{f}+\frac{(2 d) \operatorname{Subst}\left (\int \frac{1}{1+\frac{i d x^2}{a}} \, dx,x,\frac{\sqrt{a+i a \tan (e+f x)}}{\sqrt{c+d \tan (e+f x)}}\right )}{f}\\ &=-\frac{2 \sqrt [4]{-1} \sqrt{a} \sqrt{d} \tanh ^{-1}\left (\frac{(-1)^{3/4} \sqrt{d} \sqrt{a+i a \tan (e+f x)}}{\sqrt{a} \sqrt{c+d \tan (e+f x)}}\right )}{f}-\frac{i \sqrt{2} \sqrt{a} \sqrt{c-i d} \tanh ^{-1}\left (\frac{\sqrt{2} \sqrt{a} \sqrt{c+d \tan (e+f x)}}{\sqrt{c-i d} \sqrt{a+i a \tan (e+f x)}}\right )}{f}\\ \end{align*}

Mathematica [B]  time = 2.90595, size = 442, normalized size = 2.93 \[ -\frac{\left (\frac{1}{2}+\frac{i}{2}\right ) e^{-i (e+f x)} \sqrt{1+e^{2 i (e+f x)}} \sqrt{a+i a \tan (e+f x)} \left (\sqrt{d} \left (\log \left (\frac{(1+i) e^{\frac{i e}{2}} \left (-(1+i) \sqrt{d} \sqrt{1+e^{2 i (e+f x)}} \sqrt{c-\frac{i d \left (-1+e^{2 i (e+f x)}\right )}{1+e^{2 i (e+f x)}}}+i c \left (e^{i (e+f x)}+i\right )+d e^{i (e+f x)}-i d\right )}{d^{3/2} \left (e^{i (e+f x)}+i\right )}\right )-\log \left (\frac{(1+i) e^{\frac{i e}{2}} \left ((1+i) \sqrt{d} \sqrt{1+e^{2 i (e+f x)}} \sqrt{c-\frac{i d \left (-1+e^{2 i (e+f x)}\right )}{1+e^{2 i (e+f x)}}}+i c e^{i (e+f x)}+c+d e^{i (e+f x)}+i d\right )}{d^{3/2} \left (e^{i (e+f x)}-i\right )}\right )\right )+(1+i) \sqrt{c-i d} \log \left (2 \left (\sqrt{c-i d} e^{i (e+f x)}+\sqrt{1+e^{2 i (e+f x)}} \sqrt{c-\frac{i d \left (-1+e^{2 i (e+f x)}\right )}{1+e^{2 i (e+f x)}}}\right )\right )\right )}{f} \]

Warning: Unable to verify antiderivative.

[In]

Integrate[Sqrt[a + I*a*Tan[e + f*x]]*Sqrt[c + d*Tan[e + f*x]],x]

[Out]

((-1/2 - I/2)*Sqrt[1 + E^((2*I)*(e + f*x))]*((1 + I)*Sqrt[c - I*d]*Log[2*(Sqrt[c - I*d]*E^(I*(e + f*x)) + Sqrt
[1 + E^((2*I)*(e + f*x))]*Sqrt[c - (I*d*(-1 + E^((2*I)*(e + f*x))))/(1 + E^((2*I)*(e + f*x)))])] + Sqrt[d]*(Lo
g[((1 + I)*E^((I/2)*e)*((-I)*d + d*E^(I*(e + f*x)) + I*c*(I + E^(I*(e + f*x))) - (1 + I)*Sqrt[d]*Sqrt[1 + E^((
2*I)*(e + f*x))]*Sqrt[c - (I*d*(-1 + E^((2*I)*(e + f*x))))/(1 + E^((2*I)*(e + f*x)))]))/(d^(3/2)*(I + E^(I*(e
+ f*x))))] - Log[((1 + I)*E^((I/2)*e)*(c + I*d + I*c*E^(I*(e + f*x)) + d*E^(I*(e + f*x)) + (1 + I)*Sqrt[d]*Sqr
t[1 + E^((2*I)*(e + f*x))]*Sqrt[c - (I*d*(-1 + E^((2*I)*(e + f*x))))/(1 + E^((2*I)*(e + f*x)))]))/(d^(3/2)*(-I
 + E^(I*(e + f*x))))]))*Sqrt[a + I*a*Tan[e + f*x]])/(E^(I*(e + f*x))*f)

________________________________________________________________________________________

Maple [B]  time = 0.134, size = 866, normalized size = 5.7 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))^(1/2)*(c+d*tan(f*x+e))^(1/2),x)

[Out]

1/2/f*(a*(1+I*tan(f*x+e)))^(1/2)*(c+d*tan(f*x+e))^(1/2)*a*(I*2^(1/2)*(-a*(I*d-c))^(1/2)*ln(1/2*(2*I*a*tan(f*x+
e)*d+I*a*c+2*(a*(c+d*tan(f*x+e))*(1+I*tan(f*x+e)))^(1/2)*(I*a*d)^(1/2)+a*d)/(I*a*d)^(1/2))*tan(f*x+e)*d^2-I*2^
(1/2)*(-a*(I*d-c))^(1/2)*ln(1/2*(2*I*a*tan(f*x+e)*d+I*a*c+2*(a*(c+d*tan(f*x+e))*(1+I*tan(f*x+e)))^(1/2)*(I*a*d
)^(1/2)+a*d)/(I*a*d)^(1/2))*c*d+I*ln((3*a*c+I*a*tan(f*x+e)*c-I*a*d+3*a*tan(f*x+e)*d+2*2^(1/2)*(-a*(I*d-c))^(1/
2)*(a*(c+d*tan(f*x+e))*(1+I*tan(f*x+e)))^(1/2))/(tan(f*x+e)+I))*(I*a*d)^(1/2)*c^2+I*ln((3*a*c+I*a*tan(f*x+e)*c
-I*a*d+3*a*tan(f*x+e)*d+2*2^(1/2)*(-a*(I*d-c))^(1/2)*(a*(c+d*tan(f*x+e))*(1+I*tan(f*x+e)))^(1/2))/(tan(f*x+e)+
I))*(I*a*d)^(1/2)*d^2+2^(1/2)*(-a*(I*d-c))^(1/2)*ln(1/2*(2*I*a*tan(f*x+e)*d+I*a*c+2*(a*(c+d*tan(f*x+e))*(1+I*t
an(f*x+e)))^(1/2)*(I*a*d)^(1/2)+a*d)/(I*a*d)^(1/2))*tan(f*x+e)*c*d-ln((3*a*c+I*a*tan(f*x+e)*c-I*a*d+3*a*tan(f*
x+e)*d+2*2^(1/2)*(-a*(I*d-c))^(1/2)*(a*(c+d*tan(f*x+e))*(1+I*tan(f*x+e)))^(1/2))/(tan(f*x+e)+I))*(I*a*d)^(1/2)
*tan(f*x+e)*c^2-ln((3*a*c+I*a*tan(f*x+e)*c-I*a*d+3*a*tan(f*x+e)*d+2*2^(1/2)*(-a*(I*d-c))^(1/2)*(a*(c+d*tan(f*x
+e))*(1+I*tan(f*x+e)))^(1/2))/(tan(f*x+e)+I))*(I*a*d)^(1/2)*tan(f*x+e)*d^2+2^(1/2)*(-a*(I*d-c))^(1/2)*ln(1/2*(
2*I*a*tan(f*x+e)*d+I*a*c+2*(a*(c+d*tan(f*x+e))*(1+I*tan(f*x+e)))^(1/2)*(I*a*d)^(1/2)+a*d)/(I*a*d)^(1/2))*d^2)/
(a*(c+d*tan(f*x+e))*(1+I*tan(f*x+e)))^(1/2)/(I*a*d)^(1/2)/(I*c-d)/(-tan(f*x+e)+I)*2^(1/2)/(-a*(I*d-c))^(1/2)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \sqrt{i \, a \tan \left (f x + e\right ) + a} \sqrt{d \tan \left (f x + e\right ) + c}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^(1/2)*(c+d*tan(f*x+e))^(1/2),x, algorithm="maxima")

[Out]

integrate(sqrt(I*a*tan(f*x + e) + a)*sqrt(d*tan(f*x + e) + c), x)

________________________________________________________________________________________

Fricas [B]  time = 1.95359, size = 1431, normalized size = 9.48 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^(1/2)*(c+d*tan(f*x+e))^(1/2),x, algorithm="fricas")

[Out]

-1/2*sqrt(4*I*a*d/f^2)*log((sqrt(2)*sqrt(((c - I*d)*e^(2*I*f*x + 2*I*e) + c + I*d)/(e^(2*I*f*x + 2*I*e) + 1))*
sqrt(a/(e^(2*I*f*x + 2*I*e) + 1))*(e^(2*I*f*x + 2*I*e) + 1)*e^(I*f*x + I*e) + I*f*sqrt(4*I*a*d/f^2)*e^(2*I*f*x
 + 2*I*e))*e^(-2*I*f*x - 2*I*e)) + 1/2*sqrt(4*I*a*d/f^2)*log((sqrt(2)*sqrt(((c - I*d)*e^(2*I*f*x + 2*I*e) + c
+ I*d)/(e^(2*I*f*x + 2*I*e) + 1))*sqrt(a/(e^(2*I*f*x + 2*I*e) + 1))*(e^(2*I*f*x + 2*I*e) + 1)*e^(I*f*x + I*e)
- I*f*sqrt(4*I*a*d/f^2)*e^(2*I*f*x + 2*I*e))*e^(-2*I*f*x - 2*I*e)) + 1/2*sqrt(-(2*a*c - 2*I*a*d)/f^2)*log((sqr
t(2)*sqrt(((c - I*d)*e^(2*I*f*x + 2*I*e) + c + I*d)/(e^(2*I*f*x + 2*I*e) + 1))*sqrt(a/(e^(2*I*f*x + 2*I*e) + 1
))*(e^(2*I*f*x + 2*I*e) + 1)*e^(I*f*x + I*e) + I*f*sqrt(-(2*a*c - 2*I*a*d)/f^2)*e^(2*I*f*x + 2*I*e))*e^(-2*I*f
*x - 2*I*e)) - 1/2*sqrt(-(2*a*c - 2*I*a*d)/f^2)*log((sqrt(2)*sqrt(((c - I*d)*e^(2*I*f*x + 2*I*e) + c + I*d)/(e
^(2*I*f*x + 2*I*e) + 1))*sqrt(a/(e^(2*I*f*x + 2*I*e) + 1))*(e^(2*I*f*x + 2*I*e) + 1)*e^(I*f*x + I*e) - I*f*sqr
t(-(2*a*c - 2*I*a*d)/f^2)*e^(2*I*f*x + 2*I*e))*e^(-2*I*f*x - 2*I*e))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \sqrt{a \left (i \tan{\left (e + f x \right )} + 1\right )} \sqrt{c + d \tan{\left (e + f x \right )}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))**(1/2)*(c+d*tan(f*x+e))**(1/2),x)

[Out]

Integral(sqrt(a*(I*tan(e + f*x) + 1))*sqrt(c + d*tan(e + f*x)), x)

________________________________________________________________________________________

Giac [A]  time = 9.69852, size = 273, normalized size = 1.81 \begin{align*} \frac{\sqrt{2 \, a^{2} c + 2 \, \sqrt{a^{2} c^{2} +{\left (i \, a \tan \left (f x + e\right ) + a\right )}^{2} d^{2} - 2 \,{\left (i \, a \tan \left (f x + e\right ) + a\right )} a d^{2} + a^{2} d^{2}} a} d^{2}{\left (\frac{-i \,{\left (i \, a \tan \left (f x + e\right ) + a\right )} a d + i \, a^{2} d}{a^{2} c + \sqrt{a^{4} c^{2} +{\left (i \, a \tan \left (f x + e\right ) + a\right )}^{2} a^{2} d^{2} - 2 \,{\left (i \, a \tan \left (f x + e\right ) + a\right )} a^{3} d^{2} + a^{4} d^{2}}} + 1\right )} \log \left (\sqrt{i \, a \tan \left (f x + e\right ) + a}\right )}{-i \,{\left (i \, a \tan \left (f x + e\right ) + a\right )} d^{2} + 2 i \, a d^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^(1/2)*(c+d*tan(f*x+e))^(1/2),x, algorithm="giac")

[Out]

sqrt(2*a^2*c + 2*sqrt(a^2*c^2 + (I*a*tan(f*x + e) + a)^2*d^2 - 2*(I*a*tan(f*x + e) + a)*a*d^2 + a^2*d^2)*a)*d^
2*((-I*(I*a*tan(f*x + e) + a)*a*d + I*a^2*d)/(a^2*c + sqrt(a^4*c^2 + (I*a*tan(f*x + e) + a)^2*a^2*d^2 - 2*(I*a
*tan(f*x + e) + a)*a^3*d^2 + a^4*d^2)) + 1)*log(sqrt(I*a*tan(f*x + e) + a))/(-I*(I*a*tan(f*x + e) + a)*d^2 + 2
*I*a*d^2)